Skip to content

[18.0][MIG] mail_filter_adressee_by_contact (supersede)#1841

Open
Kev-Roche wants to merge 18 commits intoOCA:18.0from
akretion:18.0-mig-mail_filter_adressee_by_contact_supersede
Open

[18.0][MIG] mail_filter_adressee_by_contact (supersede)#1841
Kev-Roche wants to merge 18 commits intoOCA:18.0from
akretion:18.0-mig-mail_filter_adressee_by_contact_supersede

Conversation

@Kev-Roche
Copy link
Copy Markdown

This migration PR supersedes #123.

  • Extracts the shared logic into a mail.filter.addressee.mixin to avoid code duplication between mail.compose.message and account.move.send.wizard
  • Includes the fixes discussed in the previous PR.
  • Adding tests

@Kev-Roche Kev-Roche changed the title 18.0 mig mail filter adressee by contact supersede [18.0][MIG] mail_filter_adressee_by_contact (supersede) Mar 27, 2026
Comment on lines +12 to +13
def setUpClass(cls):
super().setUpClass()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def setUpClass(cls):
super().setUpClass()
def setUpClass(cls):
super().setUpClass()
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +1 to +3
Filter adresses by partner contacts and users. It will be applied on
mails from the following models : - account.move - sale.order -
purchase.order - stock.picking
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To get a list in README.rst and index.html

Suggested change
Filter adresses by partner contacts and users. It will be applied on
mails from the following models : - account.move - sale.order -
purchase.order - stock.picking
Filter addresses by partner contacts and users. It will be applied on
mails from the following models :
- account.move
- sale.order
- purchase.order
- stock.picking

Comment on lines +29 to +31
partner_ids_domain = fields.Char(
compute="_compute_partner_ids_domain",
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is recommended to use a Binary field to store domains.

Doing that way, there's no need to cast as str or use json.dumps in the compute method.

@@ -0,0 +1,3 @@
from . import mail_filter_addressee_mixin
from . import mail_compose_message
from . import account_invoice_send
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should rename the file to account_move_send_wizard.py

from odoo import models


class AccountInvoiceSend(models.TransientModel):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
class AccountInvoiceSend(models.TransientModel):
class AccountMoveSendWizard(models.TransientModel):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants